/**
 *
 * Copyright Pact Lab of H.I.T.
 *
 * Designed and Implemented by Grid Researching Group, 
 * Pact Lab, Harbin
 * 
 * This Project is part of the national 973 Project:
 * Internet Based Virtual Computing Environment
 *
 * http://pact518.hit.edu.cn
 * 
 * Author:       Meteor <meteorlxk@gmail.com> 
 * Copyright:    pact518 
 * Version:      1.0
 * Created:      2009-4-6 
 * LastModified: 2009-4-6
 */
package edu.hit.pact.pgse.crawler.web;

import java.util.List;

import edu.hit.pact.pgse.bean.TaskPiece;

/**
 * @author Meteor
 * 
 */
public class WebTaskPiece extends TaskPiece {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2L;

	public WebTaskPiece(Long id) {
		super(id);
		// TODO Auto-generated constructor stub
	}
	
//	private String domain;
	
	private int maxDepth;
	private String belongTo;
	private String channel;
	private String place;
	private String docURLRegexInclude;
	private String docURLRegexExclude;
	private String dateString;
	private String commentURLRegexInclude;

	/*
	 * used for web partitions
	 */
	private List<String> additionalSeeds;
	
	private List<String> exceptions;

//	public static enum TYPE {
//		WEB, 
//		BBS, BLOG
//	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append("################Task Piece##################\n");
		buffer.append("id : " + this.id + "\n");
		buffer.append("home : " + this.homePage + "\n");
		buffer.append("type : " + this.type + "\n");
		buffer.append("priority : " + this.priority + "\n");
		buffer.append("docURLRegexInclude : " + this.docURLRegexInclude + "\n");
		buffer.append("docURLRegexExclude : " + this.docURLRegexExclude + "\n");
		buffer.append("commentURLRegexInclude : " + this.commentURLRegexInclude + "\n");
		buffer.append("maxDepth : " + this.maxDepth + "\n");
		buffer.append("belongTo : " + this.belongTo + "\n");
		buffer.append("channel : " + this.channel + "\n");
		buffer.append("place : " + this.place + "\n");
		
		if (additionalSeeds != null) {
			buffer.append("additionalSeeds : \n");
			for (String seed : additionalSeeds) {
				buffer.append(seed + "\n");
			}//end for
		}//end if
		if (exceptions != null) {
			buffer.append("exceptions : \n");
			for (String exception : exceptions) {
				buffer.append(exception + "\n");
			}//end for
		}//end if
		buffer.append("############################################\n");
		return buffer.toString();
	}


	public String getDateString() {
		return dateString;
	}



	public void setDateString(String dateString) {
		this.dateString = dateString;
	}
	
	public String getDocURLRegexInclude() {
		return docURLRegexInclude;
	}



	public void setDocURLRegexInclude(String docURLRegexInclude) {
		this.docURLRegexInclude = docURLRegexInclude;
	}



	public String getDocURLRegexExclude() {
		return docURLRegexExclude;
	}



	public void setDocURLRegexExclude(String docURLRegexExclude) {
		this.docURLRegexExclude = docURLRegexExclude;
	}



	public String getCommentURLRegexInclude() {
		return commentURLRegexInclude;
	}



	public void setCommentURLRegexInclude(String commentURLRegexInclude) {
		this.commentURLRegexInclude = commentURLRegexInclude;
	}



	/**
	 * @return the maxDepth
	 */
	public int getMaxDepth() {
		return maxDepth;
	}

	/**
	 * @param maxDepth the maxDepth to set
	 */
	public void setMaxDepth(int maxDepth) {
		this.maxDepth = maxDepth;
	}

	/**
	 * @return the additionalSeeds
	 */
	public List<String> getAdditionalSeeds() {
		return additionalSeeds;
	}

	/**
	 * @param additionalSeeds the additionalSeeds to set
	 */
	public void setAdditionalSeeds(List<String> additionalSeeds) {
		this.additionalSeeds = additionalSeeds;
	}

	/**
	 * @return the exceptions
	 */
	public List<String> getExceptions() {
		return exceptions;
	}

	/**
	 * @param exceptions the exceptions to set
	 */
	public void setExceptions(List<String> exceptions) {
		this.exceptions = exceptions;
	}

	public String getBelongTo() {
		return belongTo;
	}

	public void setBelongTo(String belongTo) {
		this.belongTo = belongTo;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public String getPlace() {
		return place;
	}

	public void setPlace(String place) {
		this.place = place;
	}
	
}
